package com.mo.service.impl;

import com.mo.domain.User;
import com.mo.mapper.UserMapper;
import com.mo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;
import java.util.List;

/**
 * @author msy
 * @date 2022/2/22
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    /**根据id查找*/
    @Override
    public User selectUserById(Long id) {
        return userMapper.selectUserById(id);
    }

    /**查询所有用户列表*/
    @Override
    public List<User> selectUserList(User user) {
        return userMapper.selectUserList(user);
    }

    /**根据id删除*/
    @Override
    public Integer removeById(Long id) {
        return userMapper.removeById(id);
    }

    /**修改，id为必填项*/
    @Override
    public Integer updateUser(User user) {
        return userMapper.updateUser(user);
    }

    /**查询用户总数量*/
    @Override
    public Integer selectCount() {
        return userMapper.selectCount();
    }

    /**新增单个用户*/
    @Override
    public Integer insertUser(User user) {
        return userMapper.insertUser(user);
    }
}
